package com.itheima.client;

import com.itheima.ArticleApi;
import com.itheima.CommonResult;
import com.itheima.dtos.ArticleDto;
import com.itheima.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wangjiexin
 */
@RestController
public class ArticleClient implements ArticleApi{
    @Autowired
    private ArticleService articleService;
    @PostMapping("/api/v1/article/save")
    public CommonResult saveArticle(@RequestBody ArticleDto dto){
            //新增文章and 修改文章
        return CommonResult.success(articleService.saveArticle(dto));
    }
}
